<script setup lang="ts">
    import { defineEmits,defineProps} from 'vue'

    const props = defineProps({
        name: String, 
        email: String,
        hobby: String
    })

    const emit = defineEmits<{
        (e: 'log_out'): void,
        (e: "update", newName: string, newEmail: string, newHobby: string): void
    }>()

    
    function logout(){
      console.log("退出登录")
      emit('log_out')
    }

    function add(){
        const newName = 'Mark';
        const newEmail = 'ch234';
        const newHobby = '356';
        emit('update', newName, newEmail, newHobby)
    }
    
</script>

<template>
    <button @click="logout">退出</button>
    <button @click="add">更改用户</button>
</template>
